{
Traviesadora beta 0.2.0.13.33 (30.11.2008)
LastMod: 18.12.2008 by Prof1983

Copyright 2003, Joe Hildebrand

This file is part of Exodus.

Exodus is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Exodus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Exodus; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
}
unit CapPresence;

interface

uses
  Contnrs, SysUtils, Privacy, Presence, XMLTag;

const
  REV_URL  = 'http://www.aiassistant.info/'; //'$WCURL$';

type
  TCapPresence = class(TJabberPres)
  public
    constructor Create; override;
    // TODO: add accessors for ver and ext, and allow setting ext.
  end;

implementation

uses
  JabberSession, PrefController, JabberConst, XMLUtils;

{ TCapPresence }

constructor TCapPresence.Create;
var
  c: TXMLTag;
  ext: WideString;
begin
  inherited;
  // Add in client capabilities if we have them enabled.
  if GetPrivacyLevel('',MainSession.Profile)=plShowEverything {(MainSession.Prefs.getBool('client_caps'))} then
  begin
    c := AddTag('c');
    c.setAttribute('xmlns', XMLNS_CLIENTCAPS);
    c.setAttribute('node', REV_URL{MainSession.Prefs.getString('client_caps_uri')});
    c.setAttribute('ver', GetCapCacheVerString(GetPrivacylevel('',MainSession.Profile)));
    ext := MainSession.GetExtStr();
    if (ext <> '') then
      c.setAttribute('ext', ext);
  end;
end;

end.
